if (typeof jQuery != 'undefined') { // check if jquery is loaded $(document).ready(function() { $(function() { $("#accordion").accordion({ collapsible: true, active: false, heightStyle: "content" }); }); $("#accordion h3 a").click(function() { window.location = $(this).attr('href'); return false; }); $('.page_content').width($('.content').width() - 227); setTimeout(function() { if ($(window).width() > 580) { // $('.header').height($('.slideshow img').first().height()); $('.centerHeader').height($('.slideshow img').first().height()); } else { var height = $('.logo').height() + $('.slideshow img').first().height() + 20; // $('.header').css('max-height',height); $('.centerHeader').css('max-height', height); // $('.header').height(height); $('.centerHeader').height(height); } }, 100); $(window).resize(function(e) { $('.page_content').width($('.content').width() - 227); if ($(window).width() > 580) { // $('.header').height($('.slideshow img').first().height()); $('.centerHeader').height($('.slideshow img').first().height()); } else { $('.mobile_menu').fadeOut(); var height = $('.logo').height() + $('.slideshow img').first().height() + 20; // $('.header').css('max-height',height); $('.centerHeader').css('max-height', height); // $('.header').height(height); $('.centerHeader').height(height); } }); $('.mobile_menu_img').click(function(e) { e.stopPropagation(); var topDist = $(window).scrollTop(); var headMobDist = $('#header_mobile').offset().top + 35; var newDist = headMobDist - topDist; if ($('.mobile_menu').css('display') == 'none') { /*if (newDist) { $('#container_header_menu').css({'top':newDist+'px'}); } else { $('#container_header_menu').css({'top':'35px'}); }*/ $('.mobile_menu').css('width', '100%'); $('.mobile_menu').css('position', 'absolute'); $('.mobile_menu').fadeIn(); } else { $('.mobile_menu').hide(); $('.mobile_menu').css('position', 'static'); } }); $(document).click(function() { if ($(window).width() < 750) { // $('.mobile_menu').fadeOut(); } }); }); }